﻿using System;
using System.ComponentModel.DataAnnotations;

namespace K9Nano.DataAnnotations
{
    public class GuidRequiredAttribute: ValidationAttribute
    {
        public override bool IsValid(object value)
        {
            if (value is string id)
            {
                return Guid.TryParse(id, out _);
            }

            return false;
        }
    }
}